package com.karst.webnotes.chapter03
{
	import flash.events.Event;
	
	import org.papervision3d.objects.DisplayObject3D;
	import org.papervision3d.objects.primitives.Sphere;
	import org.papervision3d.view.BasicView;
	
	internal class DO3DExample extends BasicView
	{
		public function DO3DExample()
		{
			super() ;
			createView() ;
			startRendering() ;
		}

		private var do3d : DisplayObject3D = null ;
		private var childSphere : Sphere = null ;
		private function createView() : void
		{
			if( do3d == null )
				do3d = new DisplayObject3D() ;
			if( childSphere == null )
				childSphere = new Sphere( null, 200, 8, 6 ) ;
			childSphere.x = 200 ;
			do3d.addChild( childSphere ) ;
			scene.addChild( do3d ) ;
		}
		
		override protected function onRenderTick(event : Event = null ) : void
		{
			super.onRenderTick() ;
			if( do3d )
				do3d.localRotationY++ ;
		}
	}
}